﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="kartrisCouponsData" targetNamespace="http://tempuri.org/kartrisCouponsData.xsd" xmlns:mstns="http://tempuri.org/kartrisCouponsData.xsd" xmlns="http://tempuri.org/kartrisCouponsData.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Web.config" AppSettingsPropertyName="KartrisSQLConnection" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="KartrisSQLConnection (Web.config)" ParameterPrefix="@" PropertyReference="AppConfig.System.Configuration.ConfigurationManager.0.ConnectionStrings.KartrisSQLConnection.ConnectionString" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="CouponsTblAdptr" GeneratorDataComponentClassName="CouponsTblAdptr" Name="Coupons" UserDataComponentName="CouponsTblAdptr">
            <MainSource>
              <DbSource ConnectionRef="KartrisSQLConnection (Web.config)" DbObjectName="kartrisSQL.dbo.[_spKartrisCoupons_GetByID]" DbObjectType="StoredProcedure" GenerateMethods="Get" GenerateShortCommands="false" GeneratorGetMethodName="_GetByID" GetMethodModifier="Public" GetMethodName="_GetByID" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="_GetByID" UserSourceName="_GetByID">
                <SelectCommand>
                  <DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
                    <CommandText>dbo.[_spKartrisCoupons_GetByID]</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int16" Direction="Input" ParameterName="@CouponID" Precision="5" ProviderType="SmallInt" Scale="0" Size="2" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="CP_ID" DataSetColumn="CP_ID" />
              <Mapping SourceColumn="CP_CouponCode" DataSetColumn="CP_CouponCode" />
              <Mapping SourceColumn="CP_Reusable" DataSetColumn="CP_Reusable" />
              <Mapping SourceColumn="CP_Used" DataSetColumn="CP_Used" />
              <Mapping SourceColumn="CP_CreatedTime" DataSetColumn="CP_CreatedTime" />
              <Mapping SourceColumn="CP_StartDate" DataSetColumn="CP_StartDate" />
              <Mapping SourceColumn="CP_EndDate" DataSetColumn="CP_EndDate" />
              <Mapping SourceColumn="CP_DiscountValue" DataSetColumn="CP_DiscountValue" />
              <Mapping SourceColumn="CP_DiscountType" DataSetColumn="CP_DiscountType" />
              <Mapping SourceColumn="CP_Enabled" DataSetColumn="CP_Enabled" />
            </Mappings>
            <Sources>
              <DbSource ConnectionRef="KartrisSQLConnection (Web.config)" DbObjectName="kartrisSQL.dbo.[_spKartrisCoupons_GetByCouponCode]" DbObjectType="StoredProcedure" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="_GetByCouponCode" GetMethodModifier="Public" GetMethodName="_GetByCouponCode" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="_GetByCouponCode" UserSourceName="_GetByCouponCode">
                <SelectCommand>
                  <DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
                    <CommandText>dbo.[_spKartrisCoupons_GetByCouponCode]</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@CouponCode" Precision="0" ProviderType="NVarChar" Scale="0" Size="25" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
              <DbSource ConnectionRef="KartrisSQLConnection (Web.config)" DbObjectName="kartrisSQL.dbo.[_spKartrisCoupons_GetByDateTime]" DbObjectType="StoredProcedure" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="_GetByDate" GeneratorSourceName="FillBy" GetMethodModifier="Public" GetMethodName="_GetByDate" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="_GetByDate" UserSourceName="_GetByDate">
                <SelectCommand>
                  <DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
                    <CommandText>dbo.[_spKartrisCoupons_GetByDateTime]</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Year" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Month" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Day" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
              <DbSource ConnectionRef="KartrisSQLConnection (Web.config)" DbObjectName="kartrisSQL.dbo.[_spKartrisCoupons_GetSummary]" DbObjectType="StoredProcedure" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="_GetCouponGroups" GetMethodModifier="Public" GetMethodName="_GetCouponGroups" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="_GetCouponGroups" UserSourceName="_GetCouponGroups">
                <SelectCommand>
                  <DbCommand CommandType="StoredProcedure" ModifiedByUser="true">
                    <CommandText>_spKartrisCoupons_GetGroups</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
              <DbSource ConnectionRef="KartrisSQLConnection (Web.config)" DbObjectName="kartrisSQL.dbo.[_spKartrisCoupons_SearchByCode]" DbObjectType="StoredProcedure" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="_SearchByCode" GeneratorSourceName="FillBy" GetMethodModifier="Public" GetMethodName="_SearchByCode" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="_SearchByCode" UserSourceName="_SearchByCode">
                <SelectCommand>
                  <DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
                    <CommandText>dbo.[_spKartrisCoupons_SearchByCode]</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@CouponCode" Precision="0" ProviderType="NVarChar" Scale="0" Size="25" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </Sources>
          </TableAdapter>
        </Tables>
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="kartrisCouponsData" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msdata:EnforceConstraints="False" msprop:Generator_DataSetName="kartrisCouponsData" msprop:Generator_UserDSName="kartrisCouponsData">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="Coupons" msprop:Generator_UserTableName="Coupons" msprop:Generator_RowEvArgName="CouponsRowChangeEvent" msprop:Generator_TableVarName="tableCoupons" msprop:Generator_TablePropName="Coupons" msprop:Generator_RowDeletingName="CouponsRowDeleting" msprop:Generator_RowChangingName="CouponsRowChanging" msprop:Generator_RowDeletedName="CouponsRowDeleted" msprop:Generator_RowEvHandlerName="CouponsRowChangeEventHandler" msprop:Generator_TableClassName="CouponsDataTable" msprop:Generator_RowChangedName="CouponsRowChanged" msprop:Generator_RowClassName="CouponsRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="CP_ID" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnCP_ID" msprop:Generator_ColumnPropNameInRow="CP_ID" msprop:Generator_ColumnPropNameInTable="CP_IDColumn" msprop:Generator_UserColumnName="CP_ID" type="xs:short" />
              <xs:element name="CP_CouponCode" msprop:Generator_ColumnVarNameInTable="columnCP_CouponCode" msprop:Generator_ColumnPropNameInRow="CP_CouponCode" msprop:Generator_ColumnPropNameInTable="CP_CouponCodeColumn" msprop:Generator_UserColumnName="CP_CouponCode" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="25" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="CP_Reusable" msprop:Generator_ColumnVarNameInTable="columnCP_Reusable" msprop:Generator_ColumnPropNameInRow="CP_Reusable" msprop:Generator_ColumnPropNameInTable="CP_ReusableColumn" msprop:Generator_UserColumnName="CP_Reusable" type="xs:boolean" minOccurs="0" />
              <xs:element name="CP_Used" msprop:Generator_ColumnVarNameInTable="columnCP_Used" msprop:Generator_ColumnPropNameInRow="CP_Used" msprop:Generator_ColumnPropNameInTable="CP_UsedColumn" msprop:Generator_UserColumnName="CP_Used" type="xs:boolean" minOccurs="0" />
              <xs:element name="CP_CreatedTime" msprop:Generator_ColumnVarNameInTable="columnCP_CreatedTime" msprop:Generator_ColumnPropNameInRow="CP_CreatedTime" msprop:Generator_ColumnPropNameInTable="CP_CreatedTimeColumn" msprop:Generator_UserColumnName="CP_CreatedTime" type="xs:dateTime" minOccurs="0" />
              <xs:element name="CP_StartDate" msprop:Generator_ColumnVarNameInTable="columnCP_StartDate" msprop:Generator_ColumnPropNameInRow="CP_StartDate" msprop:Generator_ColumnPropNameInTable="CP_StartDateColumn" msprop:Generator_UserColumnName="CP_StartDate" type="xs:dateTime" minOccurs="0" />
              <xs:element name="CP_EndDate" msprop:Generator_ColumnVarNameInTable="columnCP_EndDate" msprop:Generator_ColumnPropNameInRow="CP_EndDate" msprop:Generator_ColumnPropNameInTable="CP_EndDateColumn" msprop:Generator_UserColumnName="CP_EndDate" type="xs:dateTime" minOccurs="0" />
              <xs:element name="CP_DiscountValue" msprop:Generator_ColumnVarNameInTable="columnCP_DiscountValue" msprop:Generator_ColumnPropNameInRow="CP_DiscountValue" msprop:Generator_ColumnPropNameInTable="CP_DiscountValueColumn" msprop:Generator_UserColumnName="CP_DiscountValue" type="xs:decimal" minOccurs="0" />
              <xs:element name="CP_DiscountType" msprop:Generator_ColumnVarNameInTable="columnCP_DiscountType" msprop:Generator_ColumnPropNameInRow="CP_DiscountType" msprop:Generator_ColumnPropNameInTable="CP_DiscountTypeColumn" msprop:Generator_UserColumnName="CP_DiscountType" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="1" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="CP_Enabled" msprop:Generator_ColumnVarNameInTable="columnCP_Enabled" msprop:Generator_ColumnPropNameInRow="CP_Enabled" msprop:Generator_ColumnPropNameInTable="CP_EnabledColumn" msprop:Generator_UserColumnName="CP_Enabled" type="xs:boolean" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:Coupons" />
      <xs:field xpath="mstns:CP_ID" />
    </xs:unique>
  </xs:element>
</xs:schema>